import { generate } from "./codegen/index.js";
import { createCompilerCreator } from "./create-compiler.js";
import { parse } from "./parser/index.js";

export const createCompiler = createCompilerCreator(function baseCompile(
  template,
  options
) {
  const ast = parse(template.trim(), options);
  const code = generate(ast, options);
  return {
    ast,
    render: code.render,
    staticRenderFns: code.staticRenderFns,
  };
});
